use strict;
use Cwd;
use Encode;

my $dirPath = getcwd;
my @dir = ("", "ggkszd/", "ggkszd/test", "ppwp", "prpl", "qsdy", "stockExpert");
my @htmlFileList;

#先打开文件找出所有的html文件
for	(@dir){
	chdir $_;
	my $filedir = $_;
	my @fileList = <*.html>;
	for(@fileList){
		my $fileName = $_;
		my $fileInfo;
		print "$filedir/$_\n";
		open(FILE,"<","$fileName")||die"cannot open the file: $!\n";
		my @linelist = <FILE>;
		foreach my $eachline(@linelist){
			$fileInfo = $fileInfo . $eachline;
		}
		if($fileInfo =~ /<title>(.*?)<\/title>/){
			my $t = encode("gbk", decode("utf-8", $1));
			print "title = $t\n";
		}
	}
	chdir $dirPath;
}

<>;


